---
feature_name: Web Bluetooth / Discover Services & Characteristics (Async Await)
chrome_version: 55
check_min_version: true
feature_id: 5264933985976320
icon_url: icon.png
index: index.html
---

{% include_relative _includes/intro.html %}

<p>This sample illustrates the use of the Web Bluetooth API to discover all
accessible primary services with <code>server.getPrimaryServices</code> and their
characteristics from a nearby Bluetooth Low Energy Device. You may want to try
this demo with the BLE Peripheral Simulator App from the <a target="_blank"
href="https://play.google.com/store/apps/details?id=io.github.webbluetoothcg.bletestperipheral">Google
Play Store</a> and check out the <a
href="discover-services-and-characteristics.html">Discover Services &
Characteristics Sample (Promises)</a> sample.</p>

<form>
  <input id="optionalServices" type="text" list="services" size=40 placeholder="Bluetooth Services (e.g. generic_access, 0x1234)">
  <button>Discover services & characteristics</button>
</form>

{% include_relative _includes/datalist-services.html %}

{% include output_helper.html %}

{% include js_snippet.html filename='discover-services-and-characteristics-async-await.js' %}

<script>
  document.querySelector('form').addEventListener('submit', function(event) {
    event.stopPropagation();
    event.preventDefault();

    if (isWebBluetoothEnabled()) {
      ChromeSamples.clearLog();
      onButtonClick();
    }
  });
</script>

{% include_relative _includes/utils.html %}
